how to print numbers in ascending order